﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Cs2102BookingSystem.Models.HOTEL>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>
<script runat="server">

    
    public void Page_Load()
    {
        GridView1.DataSource = ViewData["List"];
        GridView1.DataBind();
        foreach (GridViewRow gvr in GridView1.Rows)
        {
            ((HyperLink)gvr.Cells[5].Controls[0]).NavigateUrl = "~/Search/ViewDetails?type=" +
                                   "&hotelName=" + gvr.Cells[1].Text.ToString() +
                                   "&branchName=" + gvr.Cells[2].Text.ToString() +
                                   "&country=" + gvr.Cells[3].Text.ToString();
           
        }
    }

   
    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        
       
    }

    protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
    {

    }

    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
</script>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   
    <form id="form1" runat="server">

    <h2 style="width: 1059px"><%: ViewData["Message"] %></h2>
  
        <% Html.RenderPartial("~/Views/Search/MainSearch.ascx"); %>
        
          <fieldset>
        <h2>Top 10 Hotels</h2>

      
        <asp:GridView ID="GridView1" runat="server" 
        Height="231px" Width="932px" CellPadding="3" BackColor="White" 
        BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
        onsorting="GridView1_Sorting" AutoGenerateColumns="False" AllowSorting="True"
        style="margin-left: 68px; margin-top: 37px;" 
                  onselectedindexchanged="GridView1_SelectedIndexChanged" >
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
            <PagerStyle ForeColor="#000066" HorizontalAlign="Left" BackColor="White" />
            <RowStyle ForeColor="#000066" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#007DBB" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#00547E" />
             <Columns>
                 <asp:ImageField DataImageUrlField="HOTELIMAGE">
                 </asp:ImageField>
                 <asp:BoundField DataField="HOTEL" HeaderText="HOTEL" />
                 <asp:BoundField HeaderText="Branch" DataField="Branch"/>
                 <asp:BoundField HeaderText="Country" DataField="Country"/>
                 <asp:BoundField DataField="Price" HeaderText="Starting Price At (S$)" />
                <asp:HyperLinkField Text="View" />
           </Columns>
        </asp:GridView>
              <br />
    </fieldset>
    </form>
    
   

</asp:Content>
